# class Player:
#     hp=100
#     def __init__(self,name,gender,room):
#         self.name=name
#         self.gender=gender
#         self.room=room
#     def war(self,):
#         pass
#
#
#
#
# print("*"*20)
# chose=input(print("# 1 创建角色\n # 2 创建房间\n # 3"))
# print("*"*20)
def numOfSubarrays( arr):
    """
    :type arr: List[int]
    :rtype: int
    """
    prefix_sum = [0 for _ in arr]
    prefix_sum[0] = arr[0]

    for i in range(1, len(arr)):
        prefix_sum[i] = prefix_sum[i - 1] + arr[i]

    MOD = 10 ** 9 + 7
    even, odd = 1, 0
    res = 0
    for i in range(len(arr)):
        if prefix_sum[i] % 2 == 0:
            res += odd
            even += 1
        else:
            res += even
            odd += 1
        res = res % MOD
    return res
li=[3,1,5,9,2,1,1,3,2]
a=numOfSubarrays(li)
print(a)
